const path = require('path')
const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin')

const projectName = require('./package.json').name.replace(/^@zlst\//, '')
const includeAssetsPrefix = process.env.NODE_ENV === 'production'
  ? (projectName + '/')
  : ''

module.exports = {
  configureWebpack: {
    devServer: {
      contentBase: [path.join(__dirname, 'public'), path.join(__dirname, 'static')]
    },
    plugins: [
      new HtmlWebpackIncludeAssetsPlugin({
        assets: [includeAssetsPrefix + 'conf/frontZlstDataAnalysisPlatform.js'],
        append: false
      })
    ]
  }
}
